<?php
/**
 * Created by PhpStorm.
 * User: EDZ
 * Date: 2020/6/22
 * Time: 17:43
 */

namespace DesignPatterns\Behavioral\Observer;


use utils\Integer;

class OctalObserver extends Observer
{
    public function __construct(Subject $subject)
    {
        $this->subject = $subject;
        $this->subject->attach($this);
    }

    public function update()
    {
        printf("Octal String: ". Integer::toOctalString( $this->subject->getState() )."\n");
    }
}